<template>
	<web-view :src="url" :progress="false"></web-view>
</template>

<script>
	let request = require('../../utils/require');
    export default {
        data() {
            return {
                url:'',
                title:'',
				code:uni.getStorageSync('code')
            }
        },
		onShow() {
		},
        onLoad(res) {
			this.getOpenid();
        },
		onReady(){
            uni.setNavigationBarTitle({
                title:this.title
            })
        },
		methods:{
			getOpenid(){
				var that = this;
				var data = {
					token: uni.getStorageSync('token')
				};
				request.post(`index.php?s=/api/user/getopenidCode&wxapp_id=` + uni.getStorageSync('web_id'), data).then(res => {
					if (res.data.code == 1) {
						window.location = res.data.data;
					}
				});
			},
		}
    }
</script>
